package io.github.center.controller;

import cn.dev33.satoken.stp.StpUtil;
import io.github.center.common.RestRequestWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 登录控制器
 *
 * @author haijun
 * @version 1.0.0
 * @email "1424132610@qq.com"
 * @date 2024.10.30 20:37
 * @since 1.0.0
 */
@Api(value = "登录控制器")
@RestRequestWrapper
public class LoginController {

    /**
     * 测试
     *
     * @return the string
     * @since 1.0.0
     */
    @GetMapping("/login")
    @ApiOperation(value = "用户登录")
    public void login() {
        StpUtil.login(1L);
    }

    /**
     * Logout
     *
     * @since 1.0.0
     */
    @GetMapping("/logout")
    @ApiOperation(value = "用户退出")
    public void logout() {
        StpUtil.logout(1L);
    }
}
